package com.hulk.boot.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

import com.hulk.boot.common.component.FastDFS;
import com.hulk.boot.common.tool.fastdfs.FastDFSFactoryBean;


/** 
* @author 作者  cmt
* 类说明 
*/

//@Configuration
public class FastDfsConfig {

	@Value(value = "${fastdfs.name}")
	private String fastdfsName;

	@Bean(name = "fastDFSFactoryBean")
	public FastDFSFactoryBean fastDFSFactoryBean() {
		FastDFSFactoryBean fastDFSFactoryBean = new FastDFSFactoryBean();
		fastDFSFactoryBean.setConfigFileName(fastdfsName);
		return fastDFSFactoryBean;
	}

	@Bean(name = "fastDFS")
    //@Qualifier("fastDFS")
	public FastDFS FastDFSManager(FastDFSFactoryBean bean) {
		
		FastDFS fastDFS = new FastDFS(bean.getObject());
		return fastDFS;
	}

}
